package com.yang.controller;



import com.yang.domain.Result;
import com.yang.service.UploadService;
import com.yang.utils.AliyunOssUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileOutputStream;


/**
 * <p>
 * 后台文件上传控制层
 * </p>
 * @author yang
 * @date 2023/5/29
 */
@RestController
public class UploadController {

    @Resource
    private UploadService uploadService;

    @PostMapping("/upload")
    public Result uploadImg(@RequestParam("img") MultipartFile img) {
        return uploadService.uploadImg(img);
    }
}